package com;

import javax.servlet.*;
import java.io.IOException;

public class MyFilter implements Filter  {
    String e;
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        e = filterConfig.getInitParameter("namespace");

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("filter执行了！！！");
        servletRequest.setCharacterEncoding("utf-8");
        servletResponse.setContentType("text/html;charset=utf-8");
        filterChain.doFilter(servletRequest,servletResponse);
    }

    @Override
    public void destroy() {

    }
}
